package school.valon.persistence.pojo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;

/**
 * The persistent class for the course database table.
 * 
 */
@Entity
@Table(name="address")
@NamedQueries({
@NamedQuery(name="Address.findAll", query="SELECT a FROM Address a"),
@NamedQuery(name="Address.deleteById", query="DELETE FROM Address WHERE adressId = :P1")
})
public class Address implements Serializable {

	private static final long serialVersionUID = 3060770289464417435L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="address_id")
	private Integer addressId;

	@Column(name="address_line1")
	private String addressLine1;

	@Column(name="address_line2")
	private String addressLine2;
	
	@Column
	private String city;

	@Column
	private String province;

	@Column
	private String country;

	@Column(name="postal_code")
	private String postalCode;

	@OneToMany(mappedBy="address", fetch=FetchType.LAZY)
	private List<School> schools;

	@OneToMany(mappedBy="address", fetch=FetchType.LAZY)
	private List<Parent> parents;

	public Integer getAddressId() {
		return addressId;
	}

	public void setAddressId(Integer addressId) {
		this.addressId = addressId;
	}

	public String getAddressLine1() {
		return addressLine1;
	}

	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}

	public String getAddressLine2() {
		return addressLine2;
	}

	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public List<School> getSchools() {
		return schools;
	}

	public void setSchools(List<School> schools) {
		this.schools = schools;
	}

	public List<Parent> getParents() {
		return parents;
	}

	public void setParents(List<Parent> parents) {
		this.parents = parents;
	}
}